package com.server;

import java.io.IOException;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher;

public class MyServer {

	public static void main(String[] args) throws IOException {

		Server server = new Server(9090);

		ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
		context.setContextPath("/");

		ServletHolder h = new ServletHolder(new HttpServletDispatcher());
		h.setInitParameter("javax.ws.rs.Application", "com.services.MyServices");
		context.addServlet(h, "/*");

		server.setHandler(context);

		try {
			server.start();
			server.join();

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}